package ttOrder.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ttOrder.dao.FoodDAOImpl;
import ttOrder.model.Food;

@Service
@Transactional
public class FoodServiceImpl implements IFoodService {
	@Autowired
	private FoodDAOImpl foodDAO;

	@Override
	public Integer deleteFood(Integer id) throws Exception {
		// TODO Auto-generated method stub
		return foodDAO.deleteFood(id);
	}

	@Override
	public void editFood(Food food) throws Exception {
		// TODO Auto-generated method stub
		foodDAO.editFood(food);
	}

	@Override
	public void createFood(Food food) throws Exception {
		// TODO Auto-generated method stub
		foodDAO.createFood(food);
	}

	@Override
	public Food getFoodById(Integer id) {
		// TODO Auto-generated method stub
		return foodDAO.getFoodById(id);
	}

	@Override
	public List<Food> findAllFood() {
		// TODO Auto-generated method stub
		return foodDAO.findAllFood();
	}
	@Override
	public List<Food> findAllFoodByFoodType(Integer id){
		return foodDAO.findAllFoodByFoodType(id);
	}
	
}
